Copyright: Copyright 1995 Rainer Schnitker
Citation: Copyright 1995 Rainer Schnitker


Main Index
RSXWIN version 3b

This document contains:

1.	Introduction

2.	Software and Hardware Requirements

3.	Running RSXWIN

4.	The utility RSXWLINK

5. 	RSXWIN options

6.	RSXWIN options from EMX

7.	RSXWIN options from RSX

8. 	Setup Environment for Programs

9. 	New in release 3-3b

10. 	Limitations

11. 	More informations and sources

12.	RSXIO.DLL

13.	Copyright and runtime license

14. 	Ftp and email

THIS SOFTWARE AND MANUAL ARE PROVIDED "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED.  BECAUSE OF THE VARIOUS HARDWARE AND SOFTWARE ENVIRONMENTS IN WHICH THIS PROGRAM MAY BE USED, NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED.

GOOD DATA PROCESSING PROCEDURE DICTATES THAT ANY PROGRAM BE THOROUGHLY TESTED WITH NON-CRITICAL DATA BEFORE RELYING ON IT.  THE USER MUST ASSUME THE ENTIRE RISK OF USING THE PROGRAM.  ANY LIABILITY OF THE SELLER WILL BE LIMITED EXCLUSIVELY TO PRODUCT REPLACEMENT OR REFUND OF PURCHASE PRICE.


Introduction
1. Introduction

This is the documentation for the RSXWIN runtime package. RSXWIN is an environment for 32-bit EMX programs under MS-Windows™ 3.1, Windows 95™ and WinOS/2. RSXWIN supports EMX version 0.8-0.9a.

RSXWIN does not need a DOS Box. All stdin, stdout, keyboard and ansi calls are mapped to window functions. RSXWIN only needs 100 KB memory. Since a DOS-box needs up to 1 MB you have more memory for your applications. Paging is reduced and your programs are faster.

RSXWIN version 3.x uses RSXIO.DLL for I/O operations that emulates a VT102 terminal (ANSI.SYS). The first release of RSXIO only uses a 80x25 terminal buffer. You cannot scroll the output (RSXWIN2a), but now you can run Emacs, Info and other termcap programs.

Programs that run with RSXWIN:

TeX386	from the emtex package

Emacs 19.27	emx port for OS/2 + DOS

Info	and all termcap/ansi.sys programs

GCC	and all tools from the emx compiler

GPP	C++ compiler

P2C	Pascal to C translator

Unsupported programs:

GDB	You can't set breakpoints, ptrace() is disabled

(Exceptions do not save 386 registers)

Programs that cannot run with RSXWIN:

Graphics	Screen access and BIOS calls

Int86Prgs	All programs calling int86() instead emx syscalls

RSXWIN 3b archive:

CTL3D    DLL - 3d controls for rsxwlink.exe

README   TXT - text file

RSHELL   C   - source of rshell.exe

RSHELL1  C   - source of rshell.exe

RSHELL   EXE - rshell emx binary

RSHELLW  EXE - link for rsxwin.exe rhell.exe

RSHELLWX EXE - link for rsxwin.exe -X rhell.exe

RSXIO    DLL - dll for I/O operations

RSXWIN   EXE - extender for emx programs

RSXWIN   INI - application environments

RSXWIN   HLP - help file to run rsxwin

RSXWINLD EXE - small rsxwin loader

RSXWLINK EXE - creates links for rsxwin.exe


Software and Hardware Requirements
2. Software and Hardware Requirements

1) 16-bit Windows version 3.1 or higher:

MS-Windows™ 3.1 enhanced mode

MS-Windows for Workgroups™ 3.11

Windows 95™

WinOS/2

2) Coprocessor for programs using floating point arithmetic (gcc -O)


Running RSXWIN
3. Running RSXWIN

Syntax:

RSXWIN.EXE <rsxwin options> MYEmxPrg <program args>

If RSXWIN cannot find "MyEmxPrg", it will also search the PATH or EMXPATH environments. Most rsxwin options are equal to RSX release 5.

a ) Running RSXWIN from the program manager:

Add the RSXWIN icon in the program manager (Files/New/Add Program):

    Description:

RSXWIN3b

    Command-line:

RSXWIN.EXE <rsxwin options> MYEmxPrg <program args>

    Directory:

rsxwin or other directory

Example for a command shell (rshell):

    Description:

RSHELL

    Command-line:

c:\rsxwin\rsxwin.exe rshell.exe

    Directory:

c:\rsxwin

b ) Running RSXWIN from a shell program (editor, TeXshell):

Examples:

1)  c:\rsxwin\rsxwin.exe -Dc:\mydocs tex386.exe texfile.tex

In this example RSXWIN must find "tex386.exe" in the current directory or in the PATH  environment. RSXWIN will set the current directory to "c:\mydocs".

2)  c:\rsxwin\rsxwin.exe -X rshell.exe

In this example RSXWIN will close the windows if rshell.exe is finished.

NOTE: Another choice is to create bound executable for DOS & RSXWIN (next chapter).


Link RSXWIN and EMX programs
4. The utility RSXWLINK

The tool "RSXWLINK" allows to patch the command-line of RSXWIN and the EMX exe-files in a short executable.

Run \rsxwin\rsxwlink.exe. The following dialog is shown:

This example will create the executable rshellwx.exe and the following command will be executed, if you run rshellwx.exe:

rsxwin.exe -X c:\rsxwin\rshell.exe

Note:

If the emx program should be searched in the PATH environment, you must delete the path name from the emx program.

Example for tex386.exe

Link: 	\tex\win\tex386w.exe

RsxWin options:

Emx program:	tex386.exe

Prg options:


RSXWIN options
5. RSXWIN options

'-X'	close the window after program termination

'-Ddir '	change directory to dir


RSXWIN options from EMX
6. RSXWIN options from EMX

This options can be used with emxbind.

-c	disable core dumps

-h#	set file handle limit to #.

-r	default disk drive

-t	truncate filename to 8.3 DOS format


RSXWIN options from RSX
7. RSXWIN options from RSX

All RSX or RSXWIN options must begin with -R.

Syntax:

a)  -Ropt1opt2opt3	      (short form)

b)  -R,opt1,opt2,opt3	      (',' are ignored)

c)  -Ropt1 -Ropt2 -Ropt3      (repeat -R)

method (c) cannot used with emxbind, use rsxopt instead

Examples:	RSX -Rx -Rs1024

use scheduler for pipes and build 1024 KB stack frame

RSX options:

s#   	set stack size in KB  (default:  256 KB)

m#	Prealloc memory for heap. This option is useful for:

- reduce realloc heap calls to DPMI host

- if DPMI realloc is buggy

Example:  -Rm1024 (prealloc 1 MB heap)

x   	enable internal scheduler for pipes - necessary for 'gcc -pipe'

O   	set OS/2 bit; necessary for pipes with emx0.8x

z   	Zero the heap. Memory from malloc() in not filled with zeros by default.


Setup Environments
8. Setup Environment for Programs

RSXWIN reads a file 'rsxwin.ini'.

Example file:

[default]

set1=INFOPATH,D:/EMX/INFO

set2=TERMCAP,D:/EMX/ETC/TERMCAP.DAT

set3=TERM,ansi-color-3

[tex386.exe]

dir=d:\emtex\doc

addpath=d:\emtex

set1=emtexdrv,d

set2=EMX,D:\EMX\BIN\EMX.EXE

set3=DVIDRVINPUT,D:\EMTEX\DOC

set4=DVIDRVFONTS,D:\TEXFONTS

set5=DVIDRVGRAPH,D:\EMTEX\DOC\GR$R

If you run 'rsxwin d:\emtex\tex386.exe' rsxwin reads the 'tex386.exe' section. The directory is changed to the 'dir' entry and the addpath entry will be appended to the old path value. All entries are optional.

Then 5 environment variables are changed. The first entry is the name and the second is the environment entry. RSXWIN tries to load entry 'set1' then 'set2'. If it does not find one entry it aborts reading entries.

If you run a program and rsxwin cannot find a section for this program, rsxwin will use the values in the default section.


News
9. New in release 3 - 3b

 RSXWIN 3 supports now:

- most emx 0.9a functions

- RSX 5 pipes

- termcap ( VT102 / ansi.sys)

- ini file

- "close window" switch

 RSXWIN 3a:

- search in path for executable

- change dir option

- fix termination if there is no coprocessor

RSXWIN 3b:

- new bind utility RSXWLINK

- RSXWIN Help file

- Rshell can run batch-files at start (rsxwin rshell.exe test.bat)


Limitations
10. Limitations

RSXWIN runs EMX programs in a 32bit flat memory block. RSXWIN is a 16bit Windows Application with a 32bit interface to the emx program. Windows runs RSXWIN in the system virtual machine and all exceptions and interrupts are only 16bit. This is the main disadvantage. All interrupt handlers will save only 16bit registers and the 32bit registers will be lost. If a EMX program does an interrupt 0x21 Windows restores only the 16bit part of EIP (program counter).

EMX programs that assume that they run in a DOS environment (Bios, DOS int 0x21, screen writes) cannot run under RSXWIN.


More information
11. More informations and sources

For more details read the documents from DPMIGCC5.ZIP. The archive contains RSX the DPMI DOS-extender for EMX and DJGPP programs. RSXWIN is written from these sources and stdio calls are implemented with the new I/O library RSXIO.DLL.


RSXIO.DLL
12. RSXIO.DLL

This DLL allows to run Windows programs with stdio functions. The write function supports ansi control strings.

It also allows "Copy & Paste". You can mark a line with the left mouse button. The right mouse button will paste the text from the clipboard to the input text.

RSXIO.DLL supports the following ANSI.SYS strings:

ESC[nA	cursor up

ESC[nB	cursor down

ESC[nC	cursor right

ESC[nD	cursor left

ESC[x;yf	move cursor to x,y

ESC[x;yH	move cursor to x,y

ESC[6n	cursor to keyboard buffer

ESC[s	save cursor

ESC[u	restore cursor

ESC[nJ	erase screen ; n = (0,1,2)

ESC[nK	erase lines ; n = (0,1,2)

ESC[7l	break lines

ESC[7h	don't break lines

ESC[x;ym	set colors (0,1,7,30-37,30-47)

The following functions are exported:

UINT CALLBACK RSXIO_GetVersion(void);

HWND CALLBACK RSXIO_Register (HINSTANCE, LPSTR, int, LPCATCHBUF);

int  CALLBACK RSXIO_Write    (HWND, LPSTR, int);

int  CALLBACK RSXIO_Read     (HWND, LPSTR, int);

int  CALLBACK RSXIO_ReadKbd  (HWND, int, int, int);

int  CALLBACK RSXIO_KbdHit   (HWND);

void CALLBACK RSXIO_WaitClose(HWND);

void CALLBACK RSXIO_CursorOn (HWND);

void CALLBACK RSXIO_CursorOff(HWND);


Copyright and runtime license
13. Copyright and runtime license

RSXWIN and RSXIO.DLL

Copyright (c) by Rainer Schnitker 1993-1995. All right reserved.

Terms for non-commercial use:

You are hereby permitted to use this windows extender in any and all non-commercial and non-shareware software programs free of any financial obligation to me, provided that if the program is distributed, it is distributed to the public, free of any charge for the program itself. There is no restriction on what kind of reselling of the above mentioned program is done (shareware houses, CD-ROMs, etc...), as long as the program is available to the public with no financial obligation to the author(s).

Licensing RSXWIN 3.x for commercial use:

If you wish to use RSXWIN version 3.x in a commercial, shareware, or any program which is to be sold or has attached to it an obligation to buy something, you MUST purchase a commercial distribution license. This license will allow royalty free distribution of one application using RSXWIN 3.x. A separate license is required for each application in which RSXWIN 3.x is used. A single licensed application may consist of more than one actual program, but all the programs within that application must be available only as part of the whole package and may not be sold separately for their own intrinsic value. The license fee is $20 U.S. for a commercial or shareware program. Once purchased, this license is valid for the life of your program, including any and all major revisions.

Contact information:

If you are interested in licensing RSXWIN 3.x for a commercial or shareware program, you may contact me via email.


Ftp and email
14. Ftp and email

Mail to:

rainer@mathematik.uni-bielefeld.de

Home address:

Rainer Schnitker

Heeper Str. 283

33607 Bielefeld

Home FTP-server:

ftp: ftp.uni-bielefeld.de

ftp: hermes.hrz.uni-bielefeld.de

dir: /pub/systems/msdos/misc

This directory contains also:

    DPMIGCC5.ZIP

RSX the DPMI-DOS-extender - runs EMX/GCC + DJGPP progroms

in a DOS-box from MS-Windows 3.1 or OS/2.

    RSXWDK2.ZIP

building full Windows Apps with EMX or DJGPP.

    RSXNT1a.ZIP

building Win32 Apps (GUI, DLL, console) with EMX.